<?php
echo $html->css ( 'tab' );
echo $html->css ( 'jquery-validate/css/screen' );
echo $html->css('start/jquery-ui-1.8.2.custom');
echo $javascript->link('jquery-ui-1.8.2.custom.min');
?>

<script type="text/javascript">
		$(document).ready(function(){
				 $.validator.setDefaults({ 
					 submitHandler: function(form) {
		        
					  form.submit();    
					}       
				});
				 
				// validate signup form on keyup and submit
				$("#f1").validate({
					rules: {
					"data[Channelmanage][name]": {
					required: true,string:true,stringMinLength:0,stringMaxLength:100
					},
					"data[Channelmanage][signatory]": {
							required: false,formatOfName:true,stringMinLength:0,stringMaxLength:100
						},
					"data[Channelmanage][startTimes]":{
							required: false,dateISO:true
						},	
					"data[Channelmanage][endTime]":{
							required: true, dateISO:true
						}
					},
					messages: {
					},
					//设置验证触发事件 
					focusInvalid: false, 
					onkeyup: false, 
					//设置错误信息提示DOM  
					errorPlacement: function(error, element) { 
					error.appendTo( element.parent()); 
					}
				});	
			});	

	$(function()
			{
				$("#deletefile").click(function(){
					file = $("#ff");   
					file.after(file.clone());   
					file.remove(); 
				});
			});
</script>
<script type="text/javascript">
	$(function(){
		$(".datepickerSpan :input").datepicker({
			inline: true
		});
		 $('.datepickerSpan :input').datepicker('option', {dateFormat: "yy-mm-dd"});
		 $('.datepickerSpan :input').datepicker( "option", "closeText", 'X' );
	});
</script>
<!-- 当前位置-->
<div id="tabmenubar">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="tabmenubartitle1"><?php echo  __('YourPosition');//您现在的位置：?></td>
		<td class="tabmenubartitle2"><?php echo __('Channelmanage');//一级目录
										   echo '>';echo __('Channelmanage');//二级目录
										   echo '>';echo __('contractmanagementlist');//二级目录
										   echo '>';?>
									<?php echo $html->tag('span', __('addcontractmanagement',true));//当前操作地用span加粗?> 						  
		</td>
	</tr>
</table>
</div>
<!-- 当前位置-->

<?php echo $form->create('Channelmanage',array('action'=>'addcontractmanagement','type'=> 'post','enctype'=>'multipart/form-data','id'=>'f1'));?>
<div class="tabflex">
<fieldset><legend><?php echo __('addcontractmanagement')?></legend>
<table width="100%" cellspacing="0" cellpadding="0" border="0"
	style="text-align: left">
	<legend><?php echo __('contractmanagementlist information')?></legend>
		<tr>
			<td width="5%"></td>
			<td width="10%"><?php echo __('contractmanagementlist Name');//合同名称?>:<font color="red">*</font></td>
			<td width="35%">
			<?php 
				echo $form->input('name',array('label'=>false,'class' => 'TextBoxE1'));	
			?>
			</td>
			<td width="5%"></td>
			<td width="10%"><?php echo __('contractmanagementlist signatory');//签约人?>:</td>
			<td width="35%">
			<?php 
				echo $form->input('signatory',array('label'=>false,'class' => 'TextBoxE1'));	
			?>
			</td>
		</tr>
		
		<tr>
			<td></td>
			<td><?php echo __('contractmanagementlist datesigned');//签约时间?>:</td>
			<td>
			<span class="datepickerSpan">
			<?php 
				echo $form->input('datesigned',array('label'=>false,'class' => 'TextBoxE1'));
			?>
			</span>
			</td>
			<td></td>
			<td><?php echo __('contractmanagementlist Coat');//合同金额?>:</td>
			<td>
			<?php 
				echo $form->input('amount',array('label'=>false,'class' => 'TextBoxE1'));
			?>
			</td>
		</tr>
		
		<tr>
			<td></td>
			<td><?php echo __('contractmanagementlist paymentmethod');//付款方式?>:</td>  
			<td>
			<?php 
				echo $form->input('paymentmethod',array('label'=>false,'class' => 'TextBoxE1'));	
			?>
			</td>
			<td></td>
			<td><?php echo __('StartUseTime');//开始时间?>:</td>
			<td>
			<span class="datepickerSpan">
			<?php 
				echo $form->input('startTime',array('label'=>false,'class' => 'TextBoxE1'));
			?>
			</span>
			</td>
		</tr>
		
		<tr>
			<td></td>
			<td><?php echo __('EndUseTime');//结束时间?>:<font color="red">*</font></td>
			<td>
			<span class="datepickerSpan">
			<?php 
				echo $form->input('endTime',array('label'=>false,'class' => 'TextBoxE1'));
			?>
			</span>
			</td>
		</tr>
	</table>
	<table width="100%" cellspacing="0" cellpadding="0" border="0" style="text-align: left">	
		<legend><?php echo __('contractmanagementlist remind')?></legend>
		<tr>
			<td width="5%"></td>
			<td width="10%"><?php echo __('Contractmanagement reminder');//提醒人?>:</td>   
			<td width="35%">
			<?php 
			echo $form->input('reminder',array('options'=>$op1,'label'=>false,'div'=>false,'class' => 'TextBoxE1'));	
				//echo $form->input('reminder',array('label'=>false));
			?>
			</td>
			<td width="5%"></td>
			<td width="10%"><?php echo __('Schedule remindTime');//提醒时间?>:</td>
			<td width="35%">
			<span class="datepickerSpan">
			<?php 
				echo $form->input('warntime',array('label'=>false,'class' => 'TextBoxE1'));
			?>
			</span>
			</td>
		</tr>
		<tr>	
			<td></td>
			<td><?php echo __('Schedule remindBefore');//提前时间?>:</td> 
			<td>
			<?php 
				echo $form->input('warnbefore',array('label'=>false,'div'=>false,'class' => 'TextBoxE1','after'=>'&nbsp;天'));
			?>
			</td>
		<td></td>
		<td><?php echo __('Schedule remindSpacing');//间隔时间:?>:</td>
		<td>
		<?php 
			echo $form->input('internaltime',array('label'=>false,'div'=>false,'class' => 'TextBoxE1','after'=>'&nbsp;分'));
		?>
		</td>
		</tr>
		<tr>
		<td></td>
		<td style="vertical-align:top;"><?php echo __('Base information');//基本信息?>:</td>
		<td  colspan="4">
		<?php 
			echo $form->textarea('basicmessage',array('label'=>false,'class' => 'areaStyle'));
		?>
		</td>
		</tr>
		<tr>
		<td></td>
		<td style="vertical-align:top;"><?php echo __('memo');//备注?>:</td>
		<td  colspan="4">
		<?php 
			echo $form->textarea('memo',array('label'=>false,'class' => 'areaStyle'));
		?>
		</td>
		</tr>
		
		<tr>
		<!--合同附件-->
		<td></td>
		<td><?php echo __('contractmanagementlist Attachment');//合同附件?>:</td>
		<td colspan="3">
			<?php 	
				echo $form->file('Specification',array('label'=>false,'name'=>'Specification','id'=>'ff','class' => 'TextBoxL txtOut','size'=>50));
			?> 
		</td>
		<td><?php echo $form->button('取消附件',array('class'=>'cancelbutton','id'=>'deletefile'));?></td>
		</tr>
		<tr>
		<td colspan="2"></td>
		<td colspan="4"><font color="red">系统默认设置为一份合同附件；如您有多份附件，可在合同信息里继续追加附件！</font></td>
		</tr>
</table>

</fieldset>
<table width="30%" cellspacing="0" cellpadding="0" border="0" style="text-align: left">
	<tr>
		<td width="50"></td>
		<td width="100"><?php echo $form->button('返回',array('type'=>'button','class'=>'backsubmit','onclick'=>'history.back(-1)'));?>  <!-- 返回上一级-->
		</td>
		<td width="100"><?php echo $form->button('重置',array('type'=>'reset','class'=>'resetsubmit'));?>  <!-- __('reset', true)取消-->
		</td>
		<td width="100"><?php echo $form->button('确定',array('type'=>'submit','class'=>'oksubmit'));?></td>

	</tr>
</table>
</div>
<?php echo $form->hidden('channelmanage_id',array('default'=>$channelmanageid));?>
<?php echo $form->end();?>
